/*
角色管理相关的API请求函数
*/
import request from '@/utils/request'

const api_name='/admin/system/sysRole'

export default{
    getPageList(page,limit,searchobj){
        return request({
            url:`${api_name}/${page}/${limit}`,
            method:'get',
            params:searchobj
        } 
        )
    },
    deletById(id){
        return request({
            url:`${api_name}/${id}`,
            method:'delete',
        
        })
    },
    saveOrUpdate(sysRole){
        return request({
            url:`${api_name}/saveOrUpdate`,
            method:'post',
            data:sysRole
        } 
        )
    },
    findById(id){
        return request({
            url:`${api_name}/${id}`,
            method:'get',
            // data:sysRole
        })
    },
    batchRemove(idList){
        return request({
            url:`${api_name}/batchRemove`,
            method:'delete',
            data:idList
        })
    },
     /*
查看某个角色的权限列表
*/
toAssign(roleId) {
    return request({
      url: `${api_name}/toAssign/${roleId}`,
      method: 'get'
    })
  },
    /*
给某个角色授权
*/
doAssign(assginMenuVo) {
    return request({
      url: `${api_name}/doAssign`,
      method: "post",
      data: assginMenuVo
    })
  }
}
